#FROM java:8
#ADD dormitorySystem.jar /opt/travel/dormitorySystem.jar
#ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","/opt/travel/dormitorySystem.jar"]
#EXPOSE 8083

#FROM java
#
#RUN /bin/cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo 'Asia/Shanghai' >/etc/timezone
#
#ADD compose/backend/target/dormitorySystem.jar /app
#CMD ["java", "-Xmx200m",  "-jar", "/app/dormitorySystem.jar"]
#
#EXPOSE 8889

#FROM java:8
#COPY *.jar /dormitorySystem.jar
#CMD ["--server.port=9000"]
#EXPOSE 9000
#ENTRYPOINT ["java","-jar", "/dormitorySystem.jar"]

#FROM java:8
#
#COPY *.jar /dormitorySystem.jar
#
#CMD ["--server.port=8889"]
#
#EXPOSE 8889
#
#ENTRYPOINT ["java","-jar", "/dormitorySystem.jar"]

# 参考
# https://blog.csdn.net/BlingblingFu/article/details/120801893


FROM maven:3.8.3-openjdk-11 AS MAVEN_BUILD
COPY pom.xml /build/
COPY src /build/src/
WORKDIR /build/
RUN mvn package

FROM maslick/minimalka:jdk11
COPY --from=MAVEN_BUILD /build/target/dormitorySystem.jar /app/
EXPOSE 9000
ENTRYPOINT ["java","-jar","/app/dormitorySystem.jar"]
